<template>
	<view class="activityItemBox">
		<view class="activityItem" v-for="(item,index) in dataItem" :key="index" @click.stop="$emit('click',3,item)">
			<view class="activityContent">
				<view class="activityImg">
					<imageSwiper class="img" :autoplay="false" :imgs="item.activityFile"></imageSwiper>
				</view>
				<view class="activityItem-right">
					<view class="activityItem-title">{{item.activityName}}</view>
					<view style="display: flex; align-items: center;">
						<image style="width: 32rpx; height: 32rpx;" src="@/static/activity/activityTime.png"></image>
						<view style="color: #979797; font-size: 28rpx;">活动时间</view>
					</view>
					<view style="display: flex; align-items: center; margin-top: 16rpx;">
						<image style="width: 32rpx; height: 32rpx;" src="@/static/activity/activityPlace.png"></image>
						<view style="color: #979797; font-size: 28rpx;">活动地点</view>
					</view>
				</view>
			</view>
			<view style="height: 1px; background-color: #e7e7e7; width: 100%; margin-top: 24rpx;"></view>
			<view class="activityItem-buttom">
				<view class="activityItem-time">{{dayText}}</view>
				<view class="activityItem-right">
					<!-- <view class="activityItem-title">{{item.activityName}}</view> -->
					<!-- <view class="activityItem-text">{{dataItem}}</view> -->
					<view class="btnList" v-if="btn">
						<view class="submitBtn" @click.stop="$emit('click',1,item)">审核</view>
						<view class="submitBtn" @click.stop="$emit('click',2,item)">签到</view>
					</view>
				</view>
			</view>
			<!-- <view class="activityImg">
				<image :src="$setImgUrl(dataItem.activityFile)" class="img" v-if="dataItem.activityFile"></image>
				<image src="@/static/common/activityImg.png" class="img"></image>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: "activityItem",
		props: {
			btn: {
				type: Boolean,
				default: true
			},
			dayText: '',
			dataItem: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.activityItemBox {
		background-color: #fff;
		margin-bottom: 32rpx;
		padding: 30rpx;
		border-radius: 8rpx;
		padding-bottom: 0;

		.activityItem-time {
			font-family: PingFang SC, PingFang SC;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.activityItem {
		border-bottom: 2rpx solid #F7F7F7;
		margin-bottom: 20rpx;
		background-color: #fff;
		border-radius: 8rpx;
		overflow: hidden;

		.activityContent{
			display: flex;
			justify-content: space-between;
		}
		
		.activityImg {
			flex-shrink: 0;
			width: 280rpx;
			height: 200rpx;
			background-image: linear-gradient(#00F2FE, #4FACFE);
			border-radius: 16rpx;
			margin-right: 20rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			.img {
				width: 276rpx;
				height: 196rpx;
				border-radius: 16rpx;
				overflow: hidden;
			}
		}
		
		.activityItem-buttom{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 24rpx 0;
		}

		.activityItem-right {
			flex: 1;

			.activityItem-title {
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 30rpx;
				color: #000000;
				margin-bottom: 20rpx;
			}

			.activityItem-text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #979797;
			}

			.btnList {
				display: flex;
				align-items: center;
				justify-content: flex-end;

				.submitBtn {
					display: inline-block;
					padding: 10rpx 26rpx;
					background: #008df6;
					border-radius: 36rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					margin-left: 20rpx;

					&:first-child {
						margin-left: 0;
					}
				}
			}
		}
	}
</style>